package com.jf.hotelreservation.demos.controller;

import com.jf.hotelreservation.demos.bean.Room;
import com.jf.hotelreservation.demos.service.RoomService;
import com.jf.hotelreservation.demos.service.impl.RoomServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/room")
public class RoomController {

    @Autowired
    private RoomService roomService;

    @GetMapping("/getRoomByHid")
    public String getRoomByHid(Integer hid){
        return roomService.queryAll(hid);
    }

    @PostMapping("/addRoom")
    public String addRoom(@RequestBody Room room){
        return roomService.addRoom(room);

    }
}
